Documents > Cookbook >Style Handling
SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
Table table = document.getTableByName("Sheet1");
Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 12, Color.BLACK);
Cell cell = table.getCellByPosition("A1");
cell.setFont(font);
Font theFont = cell.getFont();
double size = theFont.getSize();
String fontName = theFont.getFamilyName();
StyleTypeDefinitions.FontStyle fontStyle = theFont.getFontStyle();
Color fontColor = theFont.getColor();
cell.getStyleHandler().setFont(font, new Locale(Locale.CHINESE.getLanguage(), Locale.CHINA.getCountry()));
CellStyleHandler styleHandler = cell.getStyleHandler();
Font westernFont = styleHandler.getFont(Document.ScriptType.WESTERN);
Font chineseFont = styleHandler.getFont(Document.ScriptType.CJK);
Font complexFont = styleHandler.getFont(Document.ScriptType.CTL);
cell = table.getCellByPosition("A1");
cell.setStringValue("four border");
Border border = new Border(Color.RED, 1, StyleTypeDefinitions.SupportedLinearMeasure.PT);
cell.setBorders(CellBordersType.ALL_FOUR, border);
cell.setBorders(CellBordersType.LEFT_RIGHT, border);
cell.setBorders(CellBordersType.TOP_BOTTOM, border);
cell.setBorders(CellBordersType.DIAGONAL_LINES, border);
cell.setBorders(CellBordersType.LEFT, border);
cell.setBorders(CellBordersType.TOP, border);
cell.setBorders(CellBordersType.DIAGONALBLTR, border);
Border thisBorder = cell.getBorder(CellBordersType.LEFT);
thisBorder = cell.getBorder(CellBordersType.TOP);
thisBorder = cell.getBorder(CellBordersType.DIAGONALBLTR);